/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
//package oop.demo.restaurantmanagementsystem;
package top.anka1.ims.RestaurantManagementSystem;

import top.anka1.ims.RestaurantManagementSystem.Priceable;

/**
 * Ingredient class for managing individual ingredients
 * name: The name of the ingredient
 * price: The price of the ingredient
 * @author ashongtical
 * @author Anka
 */
public class Ingredient implements Priceable {
    private String name;
    private double price;

    //Constructor to initialize the ingredient
    public Ingredient(String name, double price) {
        this.name = name;
        this.price = price;
    }

    //Get the string representation of the ingredient
    @Override
    public String toString() {
        return name + " (RMB" + String.format("%.2f", price) + ")";
    }

    //Getters and Setters
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Override
    public double getPrice() {
        return price;
    }
    public void setPrice(double price) {
        this.price = price;
    }
}
